/*************************************************
filename	: opengl_graphics_context.h
author		: Stefan lulham
desc		: Contains the opengl graphics context
*************************************************/
#ifndef D_OPENGL_GRAPHICS_CONTEXT_H
#define D_OPENGL_GRAPHICS_CONTEXT_H

#include <modules\graphics\graphics_context.h>
#include <platform.h>

#include <modules\system\system_gadget.h>

//#include <gl\GL.h>
#include <lib\GL\glew.h>
#if defined(DELGE_PLATFORM_WIN32)
#include <Windows.h>
#endif

using namespace DelGE::Modules::System;

namespace DelGE
{
	namespace Modules
	{
		namespace Graphics
		{
			class OpenGLGraphicsContext : public GraphicsContext
			{
			private:
				#if defined(DELGE_PLATFORM_WIN32)
				HGLRC hRC;		// Opengl resource context
				HWND hWnd;		// Win32 window handle
				HDC hDC;		// Device context
				#endif

			public:
				OpenGLGraphicsContext(SystemGadget* pSystemGadget);
				~OpenGLGraphicsContext();

				#if defined(DELGE_PLATFORM_WIN32)
				OpenGLGraphicsContext(HWND hWnd);
				#endif

				void CreateGraphicsContext();
				void DestroyGraphicsContext();

				void SwapBuffers();
				void MakeCurrent();

				int GetWidth();
				int GetHeight();
			};
		}
	}
}

#endif